import { AmbientLight, Scene, SpotLight } from "three";
import Style from "../system/style";

export const createLight = (_scene: Scene) => {
  // 环境光
  const ambientLight = new AmbientLight(
    0xffffff,
    Style.default.ambientLightIntensity
  );
  ambientLight.name = "ambientLight";

  _scene.add(ambientLight);

  // 聚光灯（用于强调）
  const spotLight = new SpotLight(0xffffff, 300.0, 0, 0.3, 1);
  spotLight.position.set(0, 15, 0);
  spotLight.castShadow = true;
  spotLight.shadow.autoUpdate = false;
  spotLight.shadow.bias = -0.0001;
  _scene.add(spotLight);
};
